
<%@page import="com.dts.core.util.CoreHash"%>
<%@page import="com.dts.project.dao.InsurenceDAO"%>
<%@page import="java.util.Enumeration"%>
<%@page import="com.dts.project.model.InsurenceModel"%>
<%@page import="com.dts.project.model.CustomerModel"%>
<%@page import="com.dts.project.dao.CustomerDAO"%>
<html>
	xmlns="http://www.w3.org/1999/xhtml">
	<!-- DW6 -->
	<head>
		<script language="JavaScript" src="scripts/gen_validatorv31.js"
			type="text/javascript"></script>
		<script language="JavaScript" type="text/javascript"
			src="scripts/ts_picker.js"></script>
		<script language="JavaScript1.1" src="scripts/pass.js">


</script>
		<script type="text/javascript" src="scripts/image.js"> </script>
		<script type="text/javascript" src="scripts/general.js"> </script>
		<script type="text/javascript" src="scripts/adi.js"> </script>
		<script type="text/javascript" src="scripts/form_validation.js"> </script>
		<script>
 function inDate(){

  var date=new Date();
  document.addcomputer.rDate.value=date.getDate()+"-"+(date.getMonth()+1)+"-"+date.getYear();
  document.getElementById('exprId').innerHTML=0;
}
function offDate(){

var day=document.forms.register.elements("day");
var dayvalue=day.options[day.selectedIndex].value;
var month=document.forms.register.elements("month");
var monthvalue=month.options[month.selectedIndex].value;
var year=document.forms.register.elements("year");
var yearvalue=year.options[year.selectedIndex].value;

 var append1=dayvalue+"-"+monthvalue+"-"+yearvalue;

 var append=append1.split("-");

born = new Date(bD[2], bD[1]*1-1, bD[0]);
years = Math.floor((now.getTime() - born.getTime()) / (365.25 * 24 * 60 * 60 * 1000));

 if(years>21){
 document.register.doj.value=date.getDate()+"-"+(date.getMonth()+1)+"-"+date.getYear();;
}
 else{
   document.register.doj.value="";
   alert('Date Of Join Must Be Greater Then 21');
   
 }

}

function calAgeTo(){

  var day=document.forms.register.elements("day");
var dayvalue=day.options[day.selectedIndex].value;
var month=document.forms.register.elements("month");
var monthvalue=month.options[month.selectedIndex].value;
var year=document.forms.register.elements("year");
var yearvalue=year.options[year.selectedIndex].value;

 var append=dayvalue+"-"+monthvalue+"-"+yearvalue;

 
 now = new Date()
 bD = append.split('-');

 if(bD.length!=3){
   alert('Date Is Not Valid'); 
  document.getElementById('AgeId').innerHTML="";
  
 }
 else if(bD.length==3){
	 	born = new Date(bD[2], bD[1]*1-1, bD[0]);
	  years = Math.floor((now.getTime() - born.getTime()) / (365.25 * 24 * 60 * 60 * 1000));
    
   document.getElementById('AgeId').innerHTML=years; 
 }
}
function DOBcalc() {


var date=new Date();
register.doj.value=date;

}
function disEnable(){
  register.hQual.disabled=false;
}
 </script>
		<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
		<title>Lodging - Home Page</title>
		<meta http-equiv="Content-Type"
			content="text/html; charset=iso-8859-1" />
		<link rel="stylesheet" href="css/mm_lodging1.css" type="text/css" />
		<style type="text/css">
<!--
.style1 {
	color: #FFFFFF
}

body {
	background-color: #FFFFFF;
}
-->
</style>
	</head>
	<body>
		<table border="0" align="center" cellpadding="0" cellspacing="0">
			<tr>
				<td height="139" colspan="6" align="left" valign="top"
					nowrap="nowrap">
					<img src="images/mm_spacer.gif" alt="" width="15" height="1"
						border="0" />
					<table width="100%" border="0">
						<tr>
							<td>
								<img src="images/pidhead.jpg" alt="ds" width="100%" height="139" />
							</td>
						</tr>
					</table>
				</td>
			</tr>

			<tr bgcolor="#ffffff">
				<td colspan="6">
					<img src="images/mm_spacer.gif" alt="" width="1" height="1"
						border="0" />
				</td>
			</tr>


			<tr bgcolor="#a4c2c2">
				<td height="36" colspan="6" class="navText style1" id="navigation">


					<% String role=(String)session.getAttribute("role"); 
	if(role!=null){
	if(role.equalsIgnoreCase("ADMINISTRATOR")){
	 %>
					<jsp:include page="AdminOptions.jsp" />

					<%}else if(role.equalsIgnoreCase("customer")){ %>

					<jsp:include page="CustOptions.jsp" />

					<%}else { %>

					<jsp:include page="GeneralOptions.html" />
					<%
						}
						} else {
							response
									.sendRedirect("LoginForm.jsp?status=session expired login again....");
						}
					%>

				</td>
			</tr>


			<tr bgcolor="#ffffff">
				<td colspan="6">
					<img src="images/mm_spacer.gif" alt="" width="1" height="1"
						border="0" />
				</td>
			</tr>

			<tr bgcolor="#ffffff">
				<td colspan="2" valign="top" bgcolor="#438464">
					<table border="0" cellspacing="0" cellpadding="0" width="230">
						<tr>
							<td width="15">
								&nbsp;
							</td>
							<td width="200" class="sidebarText" id="padding">
								<span class="style1"> </span>
							</td>
							<td width="15">
								&nbsp;
							</td>
						</tr>
					</table>
				</td>
				<td width="50" valign="top">
					<img src="images/mm_spacer.gif" alt="" width="50" height="1"
						border="0" />
				</td>
				<td width="529" valign="top">

					<table border="0" cellspacing="0" cellpadding="0" width="440">

						<tr>
							<td class="bodyText" colspan="2">
									<center>
										<%
											if (request.getParameter("status") != null) {
										%>
										<strong><font color=red><%=request.getParameter("status")%></font>
										</strong>
										<%
											}
										%>
									</center>


									<input type="hidden" name="port"
										value="<%=request.getLocalPort()%>" />
									<input type="hidden" name="host"
										value="<%=request.getServerName()%>" />
						<tr>
						  <td>
							<form action="ViewAllInsurenceTermsOfPertUser.jsp">
							 <table>
							  <tr>
							  <td>
								Insurence Type
							  </td>
							  </tr>
							  <tr>
							  <td >
								<select name="itypeid" onchange="goOn();">

									<option value="select">
										-select-
									</option>
									<%
										CoreHash ch = new InsurenceDAO().getInsTypeNames();
										Enumeration em = ch.elements();
										InsurenceModel p = null;

										while (em.hasMoreElements()) {
											p = (InsurenceModel) em.nextElement();
									%>

									<option value="<%=p.getInstypeid()%>"><%=p.getInstypename()%></option>
									<%
										}
									%>
								</select>
							</td>
						</tr>
						<tr>

						<%
							String loginname = (String) session.getAttribute("user");
							String image = getServletContext().getRealPath("/userimages");

							CustomerModel cmodel = null;

							cmodel = new CustomerDAO().getCustProfile(image, loginname);
							int secno = cmodel.getCustid();
						%>

						<td>
							<input type="hidden" name="sno" value="<%=secno%>">
						</td>
						</tr>

						<tr>
							<td>
								<input type="submit" name="submit" value="View">
							</td>
						</tr>
							 </table>
							</form> 
					      </td>
						</tr>			
    
						<%
							if (request.getParameter("submit") != null) {
						%>


						<table align="center" WIDTH="900" border="0" bordercolor="black"
							bgcolor="#F4F5F7">
							<th colspan="15" bgcolor="#3179c8">
								<center>
									<b><font color="white">View All Insurence Details</font>
								</center>
							</th>
							<tr rowspan="4"></tr>



							<%
								// String loginname=(String)session.getAttribute("user"); 
									//String image=getServletContext().getRealPath("/userimages");
									InsurenceModel emodel = null;

									try {

										int secuno = Integer.parseInt(request.getParameter("sno"));
										int instype = Integer.parseInt(request.getParameter("itypeid"));
										CoreHash ch1 = new InsurenceDAO()
												.getAllInsuDetlsOfPertUser(instype, secuno);
										Enumeration em1 = ch1.elements();
										if (ch1 != null) {
							%>

							<tr>
								<td>
									Insurence Type
								</td>
								<td>
									Insurence Amt/m
								</td>
								<td>
									Insurence Start Date
								</td>
								<td>
									End Date
								</td>
								<td>
									No.Of.Terms
								</td>
								<td>
									Transactions
								</td>
								<td>
									Security No
								</td>
								<td>
									Paid Amount
								</td>
								<td>
									Paid Date
								</td>
								<td>
									Status
								</td>

							</tr>
							<%
								while (em1.hasMoreElements()) {
												emodel = (InsurenceModel) em1.nextElement();
							%>
							<tr>
								<td value="<%=emodel.getInstypeid()%>"><%=emodel.getInstypename()%></td>
								<td><%=emodel.getInsamt4mon()%></td>
								<td><%=emodel.getInsstdate()%></td>
								<td><%=emodel.getInsenddate()%></td>
								<td><%=emodel.getTerms()%></td>
								<td><%=emodel.getTxid()%></td>
								<td><%=emodel.getSecuno()%></td>
								<td><%=emodel.getPaidamt()%></td>
								<td><%=emodel.getCustpaiddate()%></td>
								<td><%=emodel.getStatus()%></td>
							</tr>
							<%
								}
										} else {
							%>

							<tr>
								<td height="24" colspan="6">
									<div align="center" class="style7">
										<strong>Not Available</strong>
									</div>
								</td>
								<%
									}
										} catch (Exception e) {
											e.printStackTrace();
										}
								%>
							
						</table>
				

						<%
							}
						%>



					</table>
				</td>
				<td width="108">
					&nbsp;
				</td>
				<td width="61">
					&nbsp;
				</td>
			</tr>

			<tr bgcolor="#ffffff">
				<td colspan="6">
					`
				</td>
			</tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>
			<tr></tr>

			<tr>
				<td height="20" colspan="6" bgcolor="#438464">
					<div align="right">
						<center>
							<span class="style2 style1">&copy;All rights reserved </span>
						</center>
					</div>
				</td>
			</tr>
		</table>
	</body>
</html>